package humanMirror.model.analyzer;

import humanMirror.model.human.SomeConstants;

/**
 * Created with IntelliJ IDEA.
 * User: Aleksandra
 * Date: 14.10.12
 * Time: 23:07
 */

public class OrganAnalyzerBuilder {

    public static OrganAnalyzer build(SomeConstants.Organs organId) {
        int LOW_NORM;
        int LOW_GOOD;
        int LOW_VERY_GOOD;
        int LOW_BED;
        String doctorName;
        switch (organId) {
            case BRAIN:
                LOW_BED = 31;
                LOW_NORM = 51;
                LOW_GOOD = 81;
                LOW_VERY_GOOD = 91;
                doctorName = "Brain doctor";
                break;
            case LIVER:
                LOW_BED = 21;
                LOW_NORM = 41;
                LOW_GOOD = 61;
                LOW_VERY_GOOD = 81;
                doctorName = "Liver doctor";
                break;
            default:
                StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
                throw new IllegalArgumentException("No parameters could be set." + stackTrace[stackTrace.length - 1]);
        }
        return new OrganAnalyzer(organId.getOrganNumber(), doctorName, LOW_BED, LOW_NORM, LOW_GOOD, LOW_VERY_GOOD);
    }

//    public static OrganAnalyzer build(int organId) {
//        int LOW_NORM;
//        int LOW_GOOD;
//        int LOW_VERY_GOOD;
//        int LOW_BED;
//        String doctorName;
//        switch (organId) {
//            case SomeConstants.BRAIN:
//                LOW_BED = 31;
//                LOW_NORM = 51;
//                LOW_GOOD = 81;
//                LOW_VERY_GOOD = 91;
//                doctorName = "Brain doctor";
//                break;
//            case SomeConstants.LIVER:
//                LOW_BED = 21;
//                LOW_NORM = 41;
//                LOW_GOOD = 61;
//                LOW_VERY_GOOD = 81;
//                doctorName = "Liver doctor";
//                break;
//            default:
//                StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
//                throw new IllegalArgumentException("No parameters could be set." + stackTrace[stackTrace.length - 1]);
//        }
//        return new OrganAnalyzer(organId, doctorName, LOW_BED, LOW_NORM, LOW_GOOD, LOW_VERY_GOOD);
//    }
}
